package com.awt.action;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * @authoer zsj
 * @date 2023/4/15 17:20
 */
public class ActionDemo {


    public static void main(String[] args) {
        Frame frame = new Frame("测试");
        Button button = new Button("确定");

        TextField textField = new TextField(10);

        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                textField.setText("hello world");
            }
        });



        frame.add(button, BorderLayout.SOUTH);
        frame.add(textField, BorderLayout.NORTH);
        frame.pack();
        frame.setVisible(true);

    }
}
